package com.zhongshan.ga.mybatis.dao;

import java.util.ArrayList;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.junit.runners.Parameterized.Parameters;

import com.zhongshan.ga.mybatis.bean.ScenicCommentImg;
import com.zhongshan.ga.mybatis.bean.ScenicSpotsDetailComment;
import com.zhongshan.ga.mybatis.bean.ScenicSpotsInfo;
import com.zhongshan.ga.mybatis.bean.SecnicConmonImg;

/**
 * 操作景点信息的数据接口
 * @author yanqi
 *
 */
public interface IScenicSpotsInfoDao {
	
	/**
	 * 根据指定下标条查询对应的景点列表信息
	 * @param townshipCode 镇区编码，
	 * @param startIndex 开始下标
	 * @param endIndex 查询条数
	 * @return ArrayList<ScenicSpotsInfo> 景点信息列表
	 */
	@Select("SELECT * FROM scenicspots where townshipCode = #{townshipCode} and isActivity = 1 LIMIT #{startIndex},#{endIndex}")
	public ArrayList<ScenicSpotsInfo> getScenicSpotsInfoList(@Param("townshipCode") String townshipCode, @Param("startIndex") int startIndex, @Param("endIndex") int endIndex);
	
	/**
	 * 根据景点系统编码获得景点信息
	 * @param scenicSpotsCode 景点系统编码
	 * @return ScenicSpotsInfo 景点信息
	 */
	@Select("SELECT * FROM scenicspots WHERE ScenicSpotsCode = #{scenicSpotsCode}")
	public ScenicSpotsInfo getScenicSpotsInfoByCode(@Param("scenicSpotsCode") String scenicSpotsCode);
	
	/**
	 * 根据条件查询评论列表
	 * @return ArrayList<ScenicSpotsDetailComment> 评论列表
	 */
	public ArrayList<ScenicSpotsDetailComment> getScenicSpotsInfoComemntList(Map<String, Object> paramMap);
	
	@Select("SELECT * FROM secnicconmonimg where CommonCode = #{code} and isActivity = 1")
	public ArrayList<SecnicConmonImg> getScenicSpotsInfoImgsList(String code);
}
